<?php
class Application_Form_AuthForm extends Zend_Form
{
    public function __construct( $_options = array() ){
        parent::__construct();

		if ( isset($_options['fields']['email']) ){
			$email = new Zend_Form_Element_Text('email');
			$email->setLabel($_options['fields']['email'].':')
				  ->setRequired();
			$this->addElement( $email );
		}

		if ( isset($_options['fields']['password']) ){
			$password = new Zend_Form_Element_Password('password');
			$password->setLabel($_options['fields']['password'].':')
					 ->setRequired();
			$this->addElement( $password );
		}

		if ( isset($_options['fields']['password2']) ){
			$password2 = new Zend_Form_Element_Password('password2');
			$password2->setLabel($_options['fields']['password2'].':')
					 ->setRequired();
			$this->addElement( $password2 );
		}
		
		// set form attributes
		$this->setMethod('post');
		if ( isset($_options['action']) ){
             $this->setAction( $_options['action'] ) ;
		}
		else{
             $this->setAction( '/auth/resert-password' ) ;
		}
		if ( isset($_options['name']) ){
             $this->setName( $_options['name'] ) ;
		}
		else{
             $this->setName( 'authFrm' ) ;
		}
    }
}
